<?php
/**
 * TbMallProduct.php class file.
 * @author wudg <544038230@qq.com>
 * @date 2020/11/16- 2:32 下午
 */

namespace common\models;


use common\models\pdd\PddMallProduct as BasePddMallProduct;


class PddMallProduct extends BasePddMallProduct
{

    /**
     * 数据变更后同步es
     * @param bool $insert
     * @param array $changedAttributes
     * @throws \yii\base\Exception
     */
//    public function afterSave($insert, $changedAttributes)
//    {
//        parent::afterSave($insert, $changedAttributes);
//        if ($this->goods_id) {
//            $countItems = PddMallProduct::find()->where(['goods_id' => $this->goods_id])->count();
//            if ($countItems) {
//                $syncEsService = new SyncEsService();
//                $syncEsService->syncMallProduct([$this->goods_id]);
//            }
//        }
//    }
}
